#ifndef BOOK_LOADER_IMPL_H
#define BOOK_LOADER_IMPL_H

#include "i.h"
#include "../format/i.h"

#include <QHash>
#include <QSharedPointer>

namespace Book
{

namespace Loader
{

class Impl : public I
{
    public:

        Impl ();

        virtual Book::DataPtr OpenBook (const Book::FileInfo& _file) const;

    private:

        template <typename _BookFormat> void RegisterBookFormat ();

        Format::I& GetFormatReader (const QString& _fileName) const;

        typedef QHash<QString, QSharedPointer<Format::I> > FormatReaders;
        FormatReaders m_FormatReaders;
};

}

}

#endif // BOOK_LOADER_IMPL_H
